package com.cole.gx095.controller;

import com.cole.gx095.Repository.SalecontractRepository;
import com.cole.gx095.entity.Salecontract;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@SpringBootTest
public class Query {
    @Autowired
    SalecontractRepository salecontractRepository;
    @Test
    @Transactional
    void manytoonequery(){
        List<Salecontract> all = salecontractRepository.findAll();
        for (Salecontract salecontract : all) {
//            System.out.println("salecontract = " + salecontract.getSalebillList().get(0).getBillstatus());
        }
    }

}
